package zuoye;
import java.util.ArrayList;
import java.util.List;

 class GroupManager {
    private List<Group> groups = new ArrayList<>();

    // 新增小组
    public void addGroup(Group group) {
        groups.add(group);
    }

    // 维护小组
    public void updateGroup(Group group) {
        for (int i = 0; i < groups.size(); i++) {
            if (groups.get(i).getId().equals(group.getId())) {
                groups.set(i, group);
                break;
            }
        }
    }

    // 小组列表
    public List<Group> getGroupList() {
        return groups;
    }
 }

class Group {
    private String id;
    private String name;
    private String classId;

    public Group(String id, String name, String classId) {
        this.id = id;
        this.name = name;
        this.classId = classId;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getClassId() {
        return classId;
    }

    public void setClassId(String classId) {
        this.classId = classId;
    }
 }
